package com.alinesno.cloud.busines.demo.gateway.dto;


import com.alinesno.cloud.common.facade.dto.BaseDto;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * 功能名： 成绩
 * 数据表：  learn_grade
 * @author wh ${authorEmail}
 * @date 2021-09-06 22:52:32
 */
public class LearnGradeDto extends BaseDto {
    private static final long serialVersionUID = 1L;
    // fields
        /**
         *  "studentId"
         */
        private String studentId;
        /**
         *  "courseId"
         */
        private String courseId;
        /**
         *  "teacherId"
         */
        private String teacherId;
        /**
         *  "grade"
         */
        private Long grade;
    //getter and setter
        public String getStudentId()

        {
            return this.studentId;
        }

        public LearnGradeDto setStudentId(String arg) {
            this.studentId = arg;
            return this;
        }
        public String getCourseId()

        {
            return this.courseId;
        }

        public LearnGradeDto setCourseId(String arg) {
            this.courseId = arg;
            return this;
        }
        public String getTeacherId()

        {
            return this.teacherId;
        }

        public LearnGradeDto setTeacherId(String arg) {
            this.teacherId = arg;
            return this;
        }
        public Long getGrade()

        {
            return this.grade;
        }

        public LearnGradeDto setGrade(Long arg) {
            this.grade = arg;
            return this;
        }

    /**
    * 快速从 dto 转换成 entity
    * @return  dto 对应的 entity
    */
    public LearnGradeDto mapToDto() {
        ObjectMapper toDtoMapper = new ObjectMapper();
        toDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        return toDtoMapper.convertValue(this,LearnGradeDto.class);
    }

    /**
    * 快速从 entity 转换成 dto
    * @return  dto 对应的 entity
    */
    public LearnGradeDto fromDto(LearnGradeDto entity) {
        ObjectMapper fromDtoMapper = new ObjectMapper();
        fromDtoMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        return fromDtoMapper.convertValue(entity,LearnGradeDto.class);
    }

}
